#ifndef __HALALGECC_H__
#define __HALALGECC_H__

	extern UINT32 HalAlgSM2_Init(UINT16 BitLen);
	extern UINT32 HalAlgSM2_GenKeyPair(void);
	extern UINT32 HalAlgSM2_Encrypt_Update(UINT8 *pInBuf, UINT32 nLen, UINT8 *pOutBuf, UINT16 *pLen);
	extern UINT32 HalAlgSM2_Decrypt_Update(UINT8 *pInBuf, UINT32 nLen, UINT8* pOutBuf, UINT16 *pLen);
	extern UINT32 HalAlgSM2_GetZValue(UINT8 *pInPubKey, UINT8 *pUserID, UINT32 nIDLen, UINT8 *pZ);
	extern UINT32 HalAlgSM2_GetHashValue(UINT8 *pUserID, UINT32 nIDLen, UINT8 *pMsg, UINT32 nMsgLen, UINT8 *pHash);
	extern UINT32 HalAlgSM2_Sign_Update(UINT8 *pHash,UINT32 nHashLen, UINT8 *pResult); 
	extern UINT32 HalAlgSM2_Verify_Update(UINT8 *pHash, UINT32 nHashLen, UINT8 *pSign, UINT32 nSignLen);
	extern UINT32 HalAlgSM2_Final(void);

	extern UINT32 HalAlgSM2_KeyExchg_Init(UINT16 BitLen);
	extern UINT32 HalAlgSM2_KeyExchg_Spons_Init(UINT8 *pOutSponsorEp); 
	extern UINT32 HalAlgSM2_KeyExchg_Spons_Update(UINT8* pInResponserPubKey, UINT8 *pInResponserEp, UINT8 *pInSponsorID, UINT32 SponsorIDLen, UINT8* pInResponserID, UINT32 ResponserIDLen, UINT32 SymmKeyLen, UINT8 *pOutSymmKey); 
	extern UINT32 HalAlgSM2_KeyExchg_Response_Update(UINT8* pInSponsorPubKey, UINT8 *pInSponsorEp, UINT8 *pInSponsorID, UINT32 SponsorIDLen, UINT8* pInResponserID, UINT32 ResponserIDLen, UINT32 SymmKeyLen, UINT8 *pOutSymmKey, UINT8 *pOutResponserEp); 
	extern UINT32 HalAlgSM2_KeyExchg_Final(void);
	
	extern UINT32 HalAlgECDSA_Init(UINT16 BitLen);
	extern UINT32 HalAlgECDSA_GenKeyPair(void);
	extern UINT32 HalAlgECDSA_Sign_Update(UINT8 *pHash,UINT32 nHashLen, UINT8 *pResult); 
	extern UINT32 HalAlgECDSA_Verify_Update(UINT8 *pHash, UINT32 nHashLen, UINT8 *pSign, UINT32 nSignLen);
	extern UINT32 HalAlgECDSA_Final(void);

	extern void *HalAlgECC_GetKeyPairContext(UINT16 *pLen);

#endif
